package com.ruoyi.store.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.store.api.RemoteStockInXService;
import com.ruoyi.system.api.dto.StockInDTO;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

@Component
public class RemoteStockInFallbackFactory implements FallbackFactory<RemoteStockInXService> {


    @Override
    public RemoteStockInXService create(Throwable cause) {
        return new RemoteStockInXService() {

            @Override
            public R<List<StockInDTO>> getListInStockInCodeList(List<String> codeList, String source) {
                return R.fail("远程调用失败");
            }

            @Override
            public R<Boolean> updateStockInPaidAmount(String code, BigDecimal paidAmount, String source) {
                return R.fail("远程调用失败");
            }
        };
    }
}
